using AtomicCms.Common.Logging;
using AtomicCms.Data.EntityFramework;
using AtomicCms.Services.IoC;
using StructureMap.Pipeline;

namespace AtomicCms.Web.Core.IoC
{
    using Common;
    using Configuration;
    using Data.Concrete;
    using Services.Abstract;
    using Services.Concrete;
    using StructureMap;

    public class StructureMapRegistration
    {
        public static void RegisterAll()
        {
            ObjectFactory.Initialize(x =>
                                         {
                                             x.AddRegistry<EntityFrameworkRegistry>();
                                             x.AddRegistry<DatabaseRegistry>();
                                             x.AddRegistry<ServiceRegistry>();
                                             x.For<IConfigurationManager>().Use<ConfigurationManagerWrapper>();
                                             x.For<ILoggingService>().Use<LoggingService>();
                                             x.For<IAtomicCmsDataContext>().Add(new AtomicCmsEntities());
                                         });
        }
    }
}